package org.karelun.rabbit.rcp.policy;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.edit.command.DeleteCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.karelun.ideaboard.gef.editpolicies.ComponentEditPolicy;
import org.karelun.ideaboard.gef.requests.GroupRequest;
import org.karelun.rabbit.graph.Shape;

public class DeleteShapeEditPolicy extends ComponentEditPolicy{
	
	protected Command createDeleteCommand(GroupRequest deleteRequest) {
		Shape shape=(Shape)getHost().getModel();
		List<Object> collection=new ArrayList<Object>();
		collection.add(shape);
		
		EditingDomain editingDomain = getEditingDomain(getHost());
		return DeleteCommand.create(editingDomain, collection);
	}
}
